Skip to content

chore: update schemas from constructive-db - #2005

Closed
Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/20261116-070628
Closed

Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/20261116-070628

Conversation

@Anmol1696

Copy link
Copy Markdown
Contributor

Automated Schema + SDK Update

This PR was created by the schema-propagation workflow.

What changed

Updated schema files from constructive-db and regenerated ALL SDK clients.

Source: constructive-db@020ea4d9956

Schemas updated

  • sdk/constructive-sdk/schemas/ — all API targets from constructive-db (auto-discovered)
  • sdk/migrate-client/schemas/ — migrate
  • pgpm/export/src/meta-export-tables.json — generated meta export table list

Clients regenerated

  • sdk/constructive-sdk/src/ — ORM client
  • sdk/constructive-cli/src/ — CLI client
  • sdk/constructive-react/src/ — React hooks
  • sdk/migrate-client/src/ — Migrate client

Skill references updated

  • .agents/skills/ — Generated skill documentation

Auto-generated by constructive-hub schema-propagation

Auto-generated by schema-propagation workflow.
Source: constructive-db@020ea4d9956
@luxor-code-review

luxor-code-review Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Review complete. 🟡 1 medium

💬 Inline comments (1)

🧹 Nitpicks (5) — 🟢 5 low
  • 🟢 Stale usage strings advertise removed create subcommand (ast-migration.ts:33) — The create subcommand was removed from many generated CLI command files, but their static usage help strings still list create Create a new <table> (sdk/constructive-cli/src/api/cli/commands/ast-migration.ts:33).
  • 🟢 CreatePrincipalInput reshaped without migration note (input-types.ts:2022) — CreatePrincipalInput changed from a nested table-create shape (principal: { ownerId, parentPrincipalId, createdBySessionId, ... }) to a flat custom-mutation input (bypassStepUp, entityIds, isReadOnly, name, useAdminOwner) (sdk/constructive-cli/src/auth/orm/input-types.ts:2022), and the row-based PrincipalModel.create() was removed in favor of the new custom createPrincipal mutation.
  • 🟢 Broad SDK surface removals ship without deprecation (input-types.ts:235) — The regeneration removes public SDK surface with no deprecation window: the EXPIRED member of FileStatus (sdk/constructive-cli/src/storage/orm/input-types.ts:235), the resolveRoute/resolveDeepLink/resolveSiteAppLinks/apiSchemaNames custom queries, dbname and enableDirectUploads fields (replaced by serviceHostname), the uploadUpload/profilePictureUpload patch fields, the BuilderBinding→ServiceBinding rename across compute models, and the create() methods with their Create*Input types on many record/resource models.
  • 🟢 Behavioral contract changes need release notes (index.ts:22) — Two mutation/query contracts changed semantics without changing shape: constructBlueprint now enqueues a background job and returns a pending blueprint_construction id immediately (poll pending → constructing → constructed/failed with a new error field) instead of completing synchronously (sdk/constructive-sdk/src/modules/orm/mutation/index.ts:23), and VectorNearbyInput.vector became optional with server-enforced exactly-one-of text/vector validation, so payloads sending both or neither now fail at request time rather than at type-check (sdk/constructive-sdk/src/agent/orm/input-types.ts:4844).
  • 🟢 Presigned PUT now requires forwarding uploadHeaders (storage.graphql:3396) — The upload contract changed: UploadFilePayload/UploadPlatformFilePayload and their bulk variants now return uploadHeaders, described as the exact header set the presigned uploadUrl is signed over (sdk/constructive-sdk/schemas/storage.graphql:3396).

This PR is a codegen regeneration across four SDK packages, so nearly every change mirrors a schema edit. The schemas are the source of truth for what changed: additions (serviceBinding*, platformReservedSubdomain CRUD, four new auth mutations, Api.serviceHostname, uploadHeaders) and removals (BuilderBinding/PlatformBuilderBinding, createFile/createPlatformFile with the Upload scalar, *Upload root fields, record-style create mutations, resolveRoute/resolveDeepLink/resolveSiteAppLinks/apiSchemaNames, dbname/enableDirectUploads, FileStatus.EXPIRED). Cross-package consistency was verified: deleted hooks and models are gone from every index, the compute invalidation/query-key maps track the rename, and CLI command routers match the on-disk command files.

Files Change
sdk/constructive-sdk/schemas/*.graphql, sdk/migrate-client/schemas/migrate.graphql Regenerated schema dumps: additions and removals enumerated above, plus meta-schema and doc-comment updates
sdk/constructive-cli/src/**, sdk/constructive-sdk/src/**, sdk/constructive-react/src/** (ORM models, input types, mutation/query indexes) Regenerated TS mirroring the schema edits; BuilderBinding→ServiceBinding rename applied consistently
sdk/constructive-react/src/*/hooks/** New/removed React Query hooks with matching query/mutation key factories and invalidation maps
sdk/constructive-cli/src/*/cli/commands.ts and command files Command registrations added/removed to track the operation surface
.agents/skills/cli-*, hooks-*, orm-* references Regenerated skill docs describing the new/removed operations

The regeneration itself is internally consistent; the findings below concern generated output that is stale or behaviorally surprising for downstream consumers, not hand-written code.

Reviewed commit: 2e6e4c3

@luxor-code-review luxor-code-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regenerates the SDK artifacts (sdk/* CLI/ORM/React hooks and sdk/*/schemas/*.graphql) plus the .agents/skills reference docs from updated GraphQL schemas, adding ServiceBinding, PlatformReservedSubdomain, and auth mutations (createPrincipal, ensureAuthCsrf, exchangeNativeHandoff, requestDeviceApproval) while removing BuilderBinding, upload mutations/scalar, record-style create mutations, and dbname/enableDirectUploads fields.

Key findings

Comment on lines 43 to 54
return useMutation({
mutationKey: principalMutationKeys.create(),
mutationFn: (data: CreatePrincipalInput['principal']) =>
mutationKey: customMutationKeys.createPrincipal(),
mutationFn: (variables: CreatePrincipalVariables) =>
getClient()
.principal.create({
data,
.mutation.createPrincipal(variables, {
select: args.select,
})
} as {
select: S;
} & StrictSelect<S, CreatePrincipalPayloadSelect>)
.unwrap(),
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: principalKeys.lists(),
});
},
...mutationOptions,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 bug · medium

Regenerated create mutations lost cache invalidation

The regenerated useCreatePrincipalMutation dropped the onSuccess cache invalidation that the previous table-based version performed (queryClient.invalidateQueries({ queryKey: principalKeys.lists() })); the new hook only wires mutationKey and mutationFn (sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts:43). Principal list queries served by the still-exported principal query hooks now serve stale data after a successful create until their next refetch window. The same regression applies to useCreateFunctionGraphMutation, which previously invalidated functionGraphKeys.lists() (sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts:46).

📋 Prompt for AI Agents

In the @constructive-io/graphql-codegen template that emits custom-mutation hooks, restore the dropped onSuccess cache invalidation: after a successful createPrincipal, call queryClient.invalidateQueries({ queryKey: principalKeys.lists() }) (regenerates sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts lines 43-54), and after createFunctionGraph invalidate functionGraphKeys.lists() (sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts lines 46-58). Import useQueryClient from @tanstack/react-query and the corresponding key factories from ../query-keys, and keep ...mutationOptions spread last so caller options can override the built-in handler. Then regenerate the affected packages.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by #2016 (merged), regenerated from current constructive-db main with codegen 5.25.33.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant